<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/page/template/admin_main.xhtml">

	<ui:define name="title">
			Admin
	</ui:define>

	<ui:define name="content">
		<div class="adminContent">
			<div class="article-container">
				<h3>طلبات المراجعين</h3>
				
				<div class="article-separator"></div>

				<div class="clear-floating"></div>
				
				<h:form id="f1">
				
					<p:messages id="msgs" />
					
					<p:commandButton id="cb1" value="اضافة طلب لمراجع" action="#{customerRequestsHandlerBean.preAddRequest}" ajax="false" immediate="true" />
					
					<div class="form_settings">
						<p>
							<span>الإســـــــــم الأول</span>
							<p:inputText value="#{customerRequestsHandlerBean.firstName}"></p:inputText>
						</p>
						<p>
							<span>الإســـــــــم الأخير</span>
							<p:inputText value="#{customerRequestsHandlerBean.lastName}"></p:inputText>
						</p>
						<p>
							<span>رقـــم الموبايل</span>
							<p:inputText value="#{customerRequestsHandlerBean.mobileNumber}"></p:inputText>
						</p>
					</div>
					
					<p:commandButton id="cb11" 
						action="#{customerRequestsHandlerBean.filterCustomerRequests}" value="بحث"
						ajax="false" />
					
					<p:spacer width="10px" />
					
        			<div style="margin-top:15px;" ></div>
        			  
					<p:dataTable value="#{customerRequestsHandlerBean.customerRequestsList}" var="req"  
						scrollable="true" scrollHeight="150"
						styleClass="data-table"  paginator="true" rows="10"
						paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					 rowsPerPageTemplate="5,10,15">
						
						
						<p:column headerText="اجراءات">
							<p:commandLink value="تعديل" action="#{customerRequestsHandlerBean.preEditCustomerRequest(req)}" ajax="false" />
						</p:column>
						
							<p:column headerText="تاريخ الإصدار" width="20%">
							<p:outputLabel value="#{req.getFormattedDate(req.applyDate)}" />
						</p:column>

						<p:column headerText="الإسم" width="20%">
							<p:outputLabel value="#{req.firstName} #{req.lastName}" />
						</p:column>
						
						<p:column headerText="نوع المعاملة" width="20%">
							<p:outputLabel value="#{req.getServiceTypeDescription(req.serviceType)}" />
						</p:column>
						
						<p:column headerText="رقم الموبايل" width="20%">
							<p:outputLabel value="#{req.mobileNumber}" />
						</p:column>
						
						
					</p:dataTable>
					
				</h:form>
				
			</div>
			<div class="clear-floating"></div>
			
		</div>
	</ui:define>

</ui:composition>
</html>